/*
 * SubSonic - http://subsonicproject.com
 * 
 * The contents of this file are subject to the Mozilla Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/MPL/
 * 
 * Software distributed under the License is distributed on an 
 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
*/

namespace SubSonic.QueryEngine
{
    public enum JoinType
    {
        Inner,
        Outer,
        LeftInner,
        LeftOuter,
        RightInner,
        RightOuter,
        Cross,
        NotEqual
    }

    /// <summary>
    /// Summary for the Join class
    /// </summary>
    public class Join
    {
        private string _fromColumnName;
        private TableSchema.Table _joinTable;
        private JoinType _joinType = JoinType.Inner;
        private string _toColumn;

        /// <summary>
        /// Gets or sets to column.
        /// </summary>
        /// <value>To column.</value>
        public string ToColumn
        {
            get { return _toColumn; }
            set { _toColumn = value; }
        }

        /// <summary>
        /// Gets or sets the name of from column.
        /// </summary>
        /// <value>The name of from column.</value>
        public string FromColumnName
        {
            get { return _fromColumnName; }
            set { _fromColumnName = value; }
        }

        /// <summary>
        /// Gets or sets the join table.
        /// </summary>
        /// <value>The join table.</value>
        public TableSchema.Table JoinTable
        {
            get { return _joinTable; }
            set { _joinTable = value; }
        }

        /// <summary>
        /// Gets or sets the type of the join.
        /// </summary>
        /// <value>The type of the join.</value>
        public JoinType JoinType
        {
            get { return _joinType; }
            set { _joinType = value; }
        }
    }
}